package com.example.demo.common.enums;


import lombok.Getter;

/**
 * 统一返回信息
 * @author yangsy
 * @since 2023-04-24
 */
@Getter
public enum CodeEnum {

    /**
     * 响应成功的状态
     */
    SUCCESS(200, "操作成功!"),

    /**
     * 响应失败的状态
     */
    FAILURE(400, "操作失败!"),
    /**
     * 响应失败的状态
     */
    FAILTOKEN(401, "校验失败!"),

    /**
     * 响应失败的状态
     */
    NOMOREFAILURE(500, "未知异常!");



    /**
     * 响应code
     */
    private final Integer code;

    /**
     * 响应消息
     */
    private final String msg;

    /**
     * 构造器
     *
     * @param code 响应code
     * @param msg  响应消息
     */
    CodeEnum(Integer code, String msg) {
        this.code = code;

        this.msg = msg;
    }

}
